// requires Gw.Equipment.js
// Development tool
function checkAttribute(attribute) {
    var report = 'Checking attribute ' + attribute.Name + '<br/>';
    
    if (!Gw.Equipment.Mods["Minor " + attribute.Name + " Rune"]) report += "Missing minor rune<br/>"
    if (!Gw.Equipment.Mods["Major " + attribute.Name + " Rune"]) report += "Missing major rune<br/>"
    if (!Gw.Equipment.Mods["Superior " + attribute.Name + " Rune"]) report += "Missing superior rune<br/>"
    
    if (!attribute.HeadId) report += 'missing HeadId<br/>';
    if (!attribute.StaffId) report += 'missing StaffId<br/>';
    if (!attribute.WandId) report += 'missing WandId<br/>';
    if (!attribute.FocusId) report += 'missing FocusId<br/>';
    
    return report;
}

function checkProfession(profession) {
    var report = 'Checking profession ' + profession.Name + '<br/>';

    if (!profession.ChestId) report += 'missing ChestId<br/>';
    if (!profession.HandsId) report += 'missing HandsId<br/>';
    if (!profession.LegsId) report += 'missing LegsId<br/>';
    if (!profession.FeetId) report += 'missing FeetId<br/>';

    for (var i in profession.Attributes) {
        var attribute = profession.Attributes[i];
        if (!attribute) report += 'wrong attribute : [' + i + ']<br/>';
        else if (i != attribute.Name) report += 'wrong attribute name : [' + i + '] != [' + attribute.Name + ']<br/>';
        else report += checkAttribute(attribute);
    }
    
    for (var i in profession.Insignias) {
        var insignia = profession.Insignias[i];
        if (!Gw.Equipment.Mods[insignia]) report += 'Missing insignia : [' + insignia + ']<br/>';
    }
    
    return report;
}

function checkProfessions() {
    for (var i in Gw.Equipment.Professions) {
        document.write(checkProfession(Gw.Equipment.Professions[i]));
    }
}

checkProfessions();
